<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta name="layout" content="mobile">
    <title>${facility.name} Forums</title>
  </head>
  <body>
    
    <h1>${facility.name} Forums</h1>
    <g:each var="forum" in="${forumList}" status="i">
      <g:form controller="forum" action="view">
        <g:hiddenField name="facilityName" value="${facility.name}"/>
        <g:hiddenField name="topic" value="${forum.topic}"/>
        <g:submitButton name="submit" value="${forum.topic}"/>
      </g:form>
      <sec:ifAnyGranted roles="ROLE_MODERATOR, ROLE_OWNER">
        <g:form action="deleteForum">
          <g:hiddenField name="name" value="${facility.name}"/>
          <g:hiddenField name="topic" value="${forum.topic}"/>
          <g:submitButton name="button" data-icon="delete" data-iconpos="notext"/>
        </g:form>
       </sec:ifAnyGranted>
      </br>
    </g:each>
    <g:form action="view">
      <g:hiddenField name="name" value="${facility.name}"/>
      <g:submitButton name="submit" value="Facility" data-icon="back"/> 
    </g:form>
  </body>
</html>
